home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / utility / 602 / sr / sr.doc < prev    next >
Text File  |  1992-04-26  |  3KB  |  69 lines

  1.             SR - String Replace.
  2.                 Version 1.0.
  3.             Michael Alan Dorman
  4.  
  5.     I wrote this program because I have *no idea* how to use
  6. SED, and wouldn't really care to learn it for something as
  7. trivial as what this program is designed to do.
  8.  
  9.     The problem was simple:  GCC 2.1 thought that the file
  10. curses.ext was a precompiled header file, and was bitching at me
  11. when it tried to #include it while I was trying to rebuild the
  12. curses package.  So I wrote this program to look through all the
  13. source files and replaces curses.ext with cursese.h.
  14.  
  15.     I added some error checking, and since I use MiNT a lot,
  16. I also added a switch to kill output on non-error conditions, so
  17. that it would background nicely.
  18.  
  19.     Now I'm distributing it, source and executable.  To use
  20. it, just type:
  21.  
  22.     sr [-q] <search string> <replacement string> <file> [file...]
  23.  
  24.     The -q makes it "quiet" so that it only does output if
  25. there's an error--it's an optional argument.  The other stuff it
  26. pretty self-explanitory.  If either the search or replacement
  27. strings is gonna have a space or such, you need to put them in
  28. quotes (assuming your shell supports that).  There needs to be at
  29. least one file, up to ?.
  30.  
  31.     Don't worry, I'm not charging anything.  It was an hour's
  32. hack.  That includes the time it took me to recompile the curses
  33. package.  It was fun.
  34.  
  35.     Oh, two things--it doesn't do regular expressions (use
  36. SED for stuff that requires that), and it doesn't glob its own
  37. files.  For those among us who aren't UN*X-heads, that means it
  38. doesn't do wild-cards.  Sorry.  I don't feel like adding it (I've
  39. written enough globbing code to last me a lifetime).  Use a shell
  40. that does wild-card expansion on the command line (BASH 1.10 for
  41. TOS or MiNT, Gulam I believe, Mupfel (the shell from Gemini)), or
  42. at least one that does batch files.  I guess that makes me sound
  43. like a jerk, but it's just the truth.  Source is included--if you
  44. write the globbing code, I'd love to see it.
  45.  
  46.     Actually, that's not totally true--I'll probably get
  47. bored one day and add globbing support and GEM-ize it and make it
  48. really pretty.  But don't expect it anytime soon--I'm about to
  49. graduate from college, and I've hit that final-semester crunch.
  50.  
  51.     Other things--since it was compiled with GCC 2.1 and the
  52. GNU libraries at PatchLevel 79, it *does* do ARGV.  That's part
  53. of why I don't support command-line wild-cards.  If you can send
  54. a command-line that long, well, why not let the shell do it?
  55.  
  56.     As usual with software of this nature, I take no
  57. responsibility for anything it may do to your computer.  It works
  58. for me, but it might trash your HD if your setup isn't exactly
  59. like mine, and I won't give you lots of money if that happens.
  60.  
  61.     Well, if you've gotten this far, and you don't think I'm
  62. some stuck up jerk, and you use the program, drop me a (virtual)
  63. line:
  64.     Michael Alan Dorman
  65.     M.DORMAN2 on GEnie
  66.     mdorman1@ua1vm.ua.edu on the Internet
  67.  
  68.  
  69.